#pragma once
#include "../engine/BattleControl.h"
#include <string>

class GameSettings
{
public:
	
	void loadFromFile(std::string filename);
//	int numPlayers;
	std::string server;
	std::string map;
	int numTanks;
};

/*!
 * \brief
 * The main "in-game" program state. 
 * 
 * This is the class that defines the game logic and
 * other game implementation specific things for in game
 * mode.
 */
class TechBattleControl : public Putin::BattleControl
{
public: // Public functions
 
	TechBattleControl(bool mp=false);
	bool initialize();
	bool loadResources();
	bool renderGraphics();
	bool update();

	bool spawnUnit(Putin::Unit* unit);

protected: // private functions
	void keyDown(char key);

	void unitClicked(int unitID, Putin::Vec3f& pos, int mouse);
	void groundClicked(Putin::Vec3f& pos, int mouse);
	void clicked(int mouse);

	void addUnitMoveCmd(Putin::Unit* u, Putin::Vec3f target);
	void sendStartMultiplay();

	// Network
	void executeCommand(Putin::NetworkCommand* nc);

	// setup function
	void preloadStaticObjects();

protected:  // members
	Putin::Vec3f mCamPos;
	Putin::Vec3f mLookAt;
	GameSettings* mSettings;

	Putin::Player* mLocalPlayer; // JUST A TEMP THING..

	std::vector<Putin::Player*> mRemotePlayers;
	bool	mInitedMP;
};

